package com.genexususa.eo.bing.test.set;

import com.genexususa.eo.bing.connection.AdGroupManager;
import com.genexususa.eo.bing.test.TestUtil;

public class ConsumeSetNegativeKeywordsToAdGroups {
    public static void main(String[] args) {
        TestUtil testUtil = new TestUtil();
        String adGroupNegativeKeywordsRequestsXML = "<Bing_AdGroupNegativeKeywordsRequestCollection xmlns=\"L2TMediaDev\">\n" +
                                                        "\t<Bing_AdGroupNegativeKeywordsRequest xmlns=\"L2TMediaDev\">\n" +
                                                            "\t\t<GxCampaignId>416149485</GxCampaignId>\n" +
                                                            "\t\t<BingCampaignId>" + testUtil.campaignId1 + "</BingCampaignId>\n" +
                                                            "\t\t<AdGroupNegativeKeywordsCollection>\n" +
                                                                "\t\t\t<AdGroupNegativeKeywords>\n" +
                                                                    "\t\t\t\t<GxAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">284894561564</GxAdGroupId>\n" +
                                                                    "\t\t\t\t<BingAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">" + testUtil.adGroup11 + "</BingAdGroupId>\n" +
                                                                    "\t\t\t\t<NegativeKeywordCollection xmlns=\"https://adcenter.microsoft.com/v8\">\n" +
                                                                        "\t\t\t\t\t<NegativeKeyword>Negative Keyword 111</NegativeKeyword>\n" +
                                                                        "\t\t\t\t\t<NegativeKeyword>Negative Keyword 112</NegativeKeyword>\n" +
                                                                    "\t\t\t\t</NegativeKeywordCollection>\n" +
                                                                "\t\t\t</AdGroupNegativeKeywords>\n" +
                                                                "\t\t\t<AdGroupNegativeKeywords>\n" +
                                                                    "\t\t\t\t<GxAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">284894561565</GxAdGroupId>\n" +
                                                                    "\t\t\t\t<BingAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">" + testUtil.adGroup12 + "</BingAdGroupId>\n" +
                                                                    "\t\t\t\t<NegativeKeywordCollection xmlns=\"https://adcenter.microsoft.com/v8\">\n" +
                                                                        "\t\t\t\t\t<NegativeKeyword>Negative Keyword 121</NegativeKeyword>\n" +
                                                                        "\t\t\t\t\t<NegativeKeyword>Negative Keyword 122</NegativeKeyword>\n" +
                                                                    "\t\t\t\t</NegativeKeywordCollection>\n" +
                                                                "\t\t\t</AdGroupNegativeKeywords>\n" +
                                                            "\t\t</AdGroupNegativeKeywordsCollection>\n" +
                                                        "\t</Bing_AdGroupNegativeKeywordsRequest>\n" +
                                                        "\t<Bing_AdGroupNegativeKeywordsRequest xmlns=\"L2TMediaDev\">\n" +
                                                            "\t\t<GxCampaignId>416149486</GxCampaignId>\n" +
                                                            "\t\t<BingCampaignId>" + testUtil.campaignId2 + "</BingCampaignId>\n" +
                                                            "\t\t<AdGroupNegativeKeywordsCollection>\n" +
                                                                "\t\t\t<AdGroupNegativeKeywords>\n" +
                                                                    "\t\t\t\t<GxAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">284894561564</GxAdGroupId>\n" +
                                                                    "\t\t\t\t<BingAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">" + testUtil.adGroup21 + "</BingAdGroupId>\n" +
                                                                    "\t\t\t\t<NegativeKeywordCollection xmlns=\"https://adcenter.microsoft.com/v8\">\n" +
                                                                        "\t\t\t\t\t<NegativeKeyword>Negative Keyword 211</NegativeKeyword>\n" +
                                                                        "\t\t\t\t\t<NegativeKeyword>Negative Keyword 212</NegativeKeyword>\n" +
                                                                    "\t\t\t\t</NegativeKeywordCollection>\n" +
                                                                "\t\t\t</AdGroupNegativeKeywords>\n" +
                                                                "\t\t\t<AdGroupNegativeKeywords>\n" +
                                                                    "\t\t\t\t<GxAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">284894561565</GxAdGroupId>\n" +
                                                                    "\t\t\t\t<BingAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">" + testUtil.adGroup22 + "</BingAdGroupId>\n" +
                                                                    "\t\t\t\t<NegativeKeywordCollection xmlns=\"https://adcenter.microsoft.com/v8\">\n" +
                                                                        "\t\t\t\t\t<NegativeKeyword>Negative Keyword 221</NegativeKeyword>\n" +
                                                                        "\t\t\t\t\t<NegativeKeyword>Negative Keyword 222</NegativeKeyword>\n" +
                                                                    "\t\t\t\t</NegativeKeywordCollection>\n" +
                                                                "\t\t\t</AdGroupNegativeKeywords>\n" +
                                                            "\t\t</AdGroupNegativeKeywordsCollection>\n" +
                                                        "\t</Bing_AdGroupNegativeKeywordsRequest>\n" +
                                                    "</Bing_AdGroupNegativeKeywordsRequestCollection>\n";
        AdGroupManager resource = new AdGroupManager();
        System.out.println("Consuming SetNegativeKeywordsToAdGroups.....");
        String userName = testUtil.userName;
        String password = testUtil.password;
        String developerToken = testUtil.developerToken;
        long customerId = testUtil.customerId;
        long customerAccountId = testUtil.customerAccountId;
        String applicationId = testUtil.applicationId;
        String result = resource.setNegativeKeywordsToAdGroups(customerAccountId, adGroupNegativeKeywordsRequestsXML);
        System.out.println("Result:\n" + result);
    }
}
